<template>
	<view class="box">
		<u-popup v-model="show3" mode="center" width="80%" :mask-close-able='false' >
			<view class="" style="width: 100%;height: 350rpx; background: linear-gradient(to bottom, #C0CEFE 0%,  #FFFFFF 46% , #FFFFFF 100%);borderRadius:23rpx">
				<view class="" style="color: #2A63D9;padding-top: 32rpx;font-size: 36rpx;text-align: center;" >
					选择领取方式
				</view>
			<view class="d_f j_c_s_b" style="padding: 52rpx 82rpx 0 82rpx;">
				<image src="https://kshk.91bak.com/imagex/tl/wechat.png" mode="widthFix" style="width: 200rpx;" @click="shows=true"></image>
				<image src="https://kshk.91bak.com/imagex/tl/alipay.png" mode="widthFix" style="width: 200rpx;" @click="showx=true"></image>
			</view>
			</view>
				<view class="d_f j_c_c">
					<image src="https://kshk.91bak.com/imagex/tl/close.png" mode="widthFix" style="width: 68rpx;margin-top: 48rpx;" @click="show3=false"></image>
				</view>
	
				</u-popup >
			<u-popup v-model="show2" mode="center" width="70%" :mask-close-able='false' borderRadius="23">
				<view class="" style="width: 100%;height: 322rpx;background-color: #FFFFFF;">
					<view class="d_f j_c_c" style="font-size: 34rpx;font-weight: bold;padding-top: 20rpx;">
						解绑成功
					</view>
					<view class="t_a_c" style="font-size: 22rpx;padding-top: 30rpx;">
						省心会员已申请解绑24小时内解绑成功
					</view>
					<view class="t_a_c" style="font-size: 22rpx;padding-top: 10rpx;">
						客服电话：028-68906666
					</view>
					<view class="t_a_c" >
							<u-button  type="primary" shape="circle" style="width: 300rpx;margin-top: 30rpx;" @click="show2=false">确定</u-button>
					</view>
				
				</view>
					</u-popup >
		<u-modal v-model="showsp" :content="contents" :show-cancel-button='true' :show-title='false'
			@confirm="confirm"></u-modal>
			<u-modal v-model="jb" :content="content1" :show-cancel-button='true' 
				@confirm="confirm1"></u-modal>
		<u-popup v-model="codeshow" mode="center" width="90%" :mask-close-able='false'>

			<image src="https://web.78keji.cn/images/shouhu/shouhubg.png" mode="widthFix"
				style="width: 100%;position: relative;"></image>
			<view class="d_f a_i_c" style="position: absolute;top: 410rpx;left: 280rpx;">
				{{quan_code}}
				<image src="https://web.78keji.cn/images/shouhu/shouhufz.png" mode="widthFix"
					style="width: 30rpx;margin-left: 10rpx;" @click="copys"></image>
			</view>
			<view class="d_f j_c_c">
				<image src="https://web.78keji.cn/images/shouhu/shouhuclose.png" mode="widthFix" style="width: 40rpx;"
					@click="codeshow=false"></image>
			</view>
			<!-- {{this.quan_code}} -->
		</u-popup>
		<u-popup v-model="show" mode="bottom" width="90%" height="600" borderRadius="54">
			<view class="d_f j_c_c a_i_c f_d_c">
				<view class="title">
					请输入购买手机号进行登录
				</view>

				<view style="margin-top: 50rpx;">
					<u-field v-model="mobile" label="手机号" placeholder="请填写手机号" maxlength="11" type="number">
					</u-field>
					<u-field v-model="code" label="验证码" placeholder="请填写验证码" type="number" maxlength="6">
						<u-button size="mini" slot="right" type="primary" @click="getCode" shape="circle"
							:disabled="disabled">{{getCodeText}}
						</u-button>
					</u-field>
				</view>
				<image src="https://web.78keji.cn/newimgaes/logins.png" mode="widthFix"
					style="600rpx;margin-top: 40rpx;" @click="login">
				</image>
			</view>


		</u-popup>
		<u-popup v-model="showx" mode="center" width="90%" :mask-close-able='false'>

			<image src="https://web.78keji.cn/newimgaes/zfb.png" mode="widthFix"
				style="width: 100%;position: relative;"></image>

			<view class="" style="width: 100%;position: absolute;top: 30rpx;">
				<view class="d_f j_c_c" style="color: #2A63D9;font-size: 36rpx;">
					确认到账支付宝账号
				</view>
				<view class="d_f j_c_c" style="width: 100%;margin-top: 48rpx;">
					<view class="d_f a_i_c "
						style="border: 1px solid #B3B3B3;width: 560rpx;height: 80rpx;border-radius: 40rpx;padding: 0 23rpx;">
						<image src="https://web.78keji.cn/newimgaes/icon.png" mode="widthFix" style="width: 43rpx;">
						</image>
						<view class="" style="width: 1rpx;
height: 40rpx;border-right: 1px solid #999999;margin-left: 12rpx;">

						</view>
						<input type="number" placeholder="请输入领取支付宝账号" style="margin-left: 12rpx;" v-model="content">
					</view>
					<!-- 	<u-input v-model="content" type="text" placeholder-style="color:#B3B3B3" :border="border"
						style="width: 536rpx;margin: 0 auto;" /> -->
				</view>
				<view class="d_f j_c_c">
					<image src="../../static/goto.png" mode="widthFix" style="width:536rpx;margin-top: 30rpx;"
						@click="viplingqu"></image>
				</view>

			</view>
			<view class="d_f j_c_c">
				<image src="https://web.78keji.cn/newimgaes/quxiao.png" mode="widthFix" style="width: 68rpx;"
					@click="showx=false"></image>
			</view>


		</u-popup>
		<u-popup v-model="shows" mode="center" width="90%" :mask-close-able='false'>

			<view class="">
				<image src="https://web.78keji.cn/newimgaes/yhtop.png" mode="widthFix"
					style="width: 100%;position: relative;"></image>
				<view class="" style="position: absolute;top: 250rpx;">
					<u-radio-group v-model="value" :wrap='true'>
						<u-radio v-for="(item, index) in listx" :key="index" :name="item.id">

							{{item.name}}
						</u-radio>

					</u-radio-group>
					<view class="" style="width: 100%;text-align: center;margin-top: 70rpx;">
						<image src="https://web.78keji.cn/newimgaes/qd.png" style="width: 580rpx;height: 88rpx;"
							@click="lingqus"></image>
					</view>

				</view>
				<view class="d_f j_c_c">
					<image src="https://web.78keji.cn/newimgaes/quxiao.png" mode="widthFix" style="width: 68rpx;"
						@click="shows=false">
					</image>
				</view>


			</view>

		</u-popup>
		<view class="" style="position: fixed;right: 0;left: 0;z-index: 1;top: 0;">
			<image src="https://web.78keji.cn/newimgaes/to.png" mode="widthFix" style="width: 100%;"></image>
			<view class="d_f a_i_c" style="position: absolute;top: 48rpx;left:30rpx ;">
				<image src="https://web.78keji.cn/newimgaes/user.png" mode="widthFix" style="width: 98rpx;"></image>
				<view class="" style="margin-left: 22rpx;" v-if="openid">
					<view class="" style="color: white;font-size: 32rpx;">
						{{mobile}}
					</view>
					<view class="" style="color: #FFFFFF;font-size: 24rpx;margin-top: 10rpx;">
						省心联合会员，立减金领取

						</image>
					</view>
				</view>

				<view class="" style="margin-left: 22rpx;" v-else>
					<view class="" style="color: white;font-size: 32rpx;" @click="show=true">
						请登录领取…
					</view>
					<view class="" style="color: #FFFFFF;font-size: 24rpx;margin-top: 10rpx;">
						省心联合会员，立减金领取

					</view>
				</view>
				<view class="" v-if="checkx">
					<image src="https://web.78keji.cn/newimgaes/change.png" mode="widthFix"
						style="width: 90rpx;margin-left: 200rpx;" @click="loginout" v-if="openid">
						<image src="../../static/login.png" mode="widthFix" style="width: 130rpx;margin-left: 125rpx;"
							@click="show=true" v-else>
						</image>
				</view>
				

			</view>
			<view class="" style="padding: 0 80rpx 0 40rpx;">
				<u-tabs :list="list" :is-scroll="true" :current="current" @change="change"
					style="margin-top: -160rpx;"></u-tabs>
			</view>

		</view>

		<view class="" v-if="openid" style="padding-top: 342rpx;">

			<view class="">
				<view class="" v-if="shcode.length==0&&(!openid||tldata.length==0)">
					<view class="d_f j_c_c">
						<image src="https://web.78keji.cn/newimgaes/no.png" mode="widthFix"
							style="width: 273rpx;margin-top: 143rpx;">
						</image>

					</view>
					<view class="d_f j_c_c" style="color: #808080;font-size: 24rpx;">
						暂无立减金
					</view>
				</view>

				<view class="" v-else>
					<!-- 	v-if="proType==8" -->
					<view class="d_f j_c_c " v-if="proType==15" style="padding-bottom: 40rpx;">

						<view class="">
							—— 大屏休闲会员 ——
						</view>
					</view>
					<view class="d_f j_c_c " v-if="proType==4||proType==1" style="padding-bottom: 40rpx;">
						<view class="" v-if="keeplistx.length>0">
							<view class="">
								—— Keep会员 ——
							</view>

						</view>

					</view>
					<view class="" v-if="proType==4||proType==1">
						<view class="" v-for="(item,index) in keeplistx" :key="index">
							<view class="" style="position: relative;padding: 0 40rpx;">
								<image src="https://web.78keji.cn/keepx.png" mode="widthFix" style="width: 100%;">
								</image>
								<view class=""
									style="text-align: left;color: #232323;font-weight: bold;position: absolute;margin-left: 200rpx;margin-top: -116rpx;"
									v-if="item.type==2">
									Keep会员月卡

								</view>
								<view class=""
									style="text-align: left;color: #232323;font-weight: bold;position: absolute;margin-left: 200rpx;margin-top: -116rpx;"
									v-if="item.type==1">
									Keep会员周卡

								</view>
								<view
									style="text-align: left;font-size: 16rpx;color: #0F0F0F;position: absolute;margin-left: 200rpx;margin-top: -68rpx;">
									有效期{{item.starttime}}-{{item.endtime}}</view>
								<view class="d_f j_c_c a_i_c"
									style="width: 136rpx;height: 50rpx;background: linear-gradient(90deg, #5B8CCF, #6570CB);border-radius: 25rpx;font-size: 24rpx;color: white;position: absolute;margin-left: 470rpx;margin-top: -100rpx;"
									@click="keepllq(item.id)" v-if="item.status==0||item.status==3">
									领取
								</view>
								<view class="d_f j_c_c a_i_c"
									style="width: 136rpx;height: 50rpx;border-radius: 25rpx;font-size: 24rpx;color: #999999;position: absolute;margin-left: 470rpx;margin-top: -100rpx;"
									@click="keepllq(item.id)" v-if="item.status==1">
									已领取
								</view>
								<view class="d_f j_c_c a_i_c"
									style="width: 136rpx;height: 50rpx;border-radius: 25rpx;font-size: 24rpx;color: #999999;position: absolute;margin-left: 470rpx;margin-top: -100rpx;"
									@click="keepllq(item.id)" v-if="item.status==2">
									已失效
								</view>
							</view>
						</view>

						<view class="d_f j_c_c " v-if="proType==4" style="padding: 40rpx 0;">


							—— 立减金 ——
						</view>
					</view>
					<view class="" v-if="proType==15">
						<view class="" style="position: relative;padding: 0 40rpx;">
							<image src="https://web.78keji.cn/images/tcl.png" mode="widthFix" style="width: 100%;">
							</image>
							<view class=""
								style="text-align: left;color: #232323;font-weight: bold;position: absolute;margin-left: 200rpx;margin-top: -116rpx;">
								大屏休闲会员

							</view>
							<view
								style="text-align: left;font-size: 16rpx;color: #0F0F0F;position: absolute;margin-left: 200rpx;margin-top: -68rpx;">
								领取后立即到账订购手机号账户</view>
							<view class="d_f j_c_c a_i_c" style="width: 136rpx;
height: 50rpx;
background: linear-gradient(90deg, #5B8CCF, #6570CB);
border-radius: 25rpx;font-size: 24rpx;color: white;position: absolute;margin-left: 500rpx;margin-top: -100rpx;"
								@click="tcllq">
								领取
							</view>
						</view>
					</view>
					<view class="d_f j_c_c "
						v-if="proType==1||proType==8||proType==9||proType==11||proType==16||proType==100"
						style="padding-bottom: 40rpx;">

						<view class="card">
							—— 团油优惠券 ——
						</view>

					</view>
					<view class="" v-for="(item,index) in shcode" :key="index"
						:class="index==shcode.length-1?'boss1':'boss'"
						v-if="proType==8||proType==1||proType==9||proType==11||proType==7||proType==16||proType==100">

						<view class="" style="position: relative;">
							<image src="https://web.78keji.cn/newimgaes/sus.png" mode="widthFix" style="width: 100%;">
							</image>
							<image src="../../static/tuan.png" mode="widthFix"
								style="width: 100rpx;position: absolute;top: 40rpx;left: 40rpx;"></image>
							<view class="" style="position: absolute;top:20rpx ;margin-left: 190rpx;">
								<view class="" style="color: #232323;font-weight: bold;">
									团油券码
								</view>
								<view class="" v-if="item.status==1" style="margin-top: 20rpx;">
									{{item.quan_code}}
								</view>
								<view class="" v-else style="margin-top: 20rpx;">
									请先领取
								</view>

							</view>
							<view class="">
								<image src="https://web.78keji.cn/newimgaes/nolinqu.png" mode="widthFix"
									style="width: 136rpx;position: absolute;top:40rpx;right: 70rpx;"
									v-if="item.status==0" @click="codelq(item)"></image>
								<view class="d_f a_i_c"
									style="color: #5EBB72;font-size: 24rpx;width: 136rpx;position: absolute;top:40rpx;right: 50rpx;"
									v-if="item.status==1" @click="copy(item)">

									<image src="../../static/copy.png" mode="widthFix" style="width: 110rpx;"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="" v-if="proType==11">
						<view class="d_f j_c_c " style="padding: 40rpx 42rpx;">
							<image src="../../static/xiaowu.jpg" mode="widthFix" style="width: 100%;" @click="xiaowu">
							</image>
						</view>

					</view>
					<view class="" v-if="proType==19">
						<view class="" style="padding:20rpx 60rpx;color: #DB202D;font-size: 24rpx;">
							权益内容:百川短剧月卡、省心app购物金100元、省心app蜂王会员、视频会员三选一。
						</view>
						<view class="" >
							<view class="" v-for="(items,index) in vip" :key="index" @click="getid(items)">

								<view class="d_f j_c_c" v-if="items.status=='0'">
									—— {{items.name}}<text style="color: #3956DA;">(未领取)</text> ——
								</view>
								<view class="d_f j_c_c" v-else>
									—— {{items.name}}<text style="color: #3956DA;">(已领取)</text> ——
								</view>
								<view class="d_f j_c_s_b " style="padding: 40rpx 42rpx;">
									<view class="" v-for="(itemx,index) in datavip" :key="index">

										<image :src="itemx.image" mode="widthFix" style="width: 118rpx;"
											@click="getsp(itemx)"></image>
									</view>


								</view>

							</view>
						</view>


						<view class="d_f a_i_c j_c_c" style="padding-bottom: 20rpx;">
							—— 立减金 ——
						</view>
					</view>
					<view class="" v-if="proType==20||proType==21">
						<view class="d_f a_i_c j_c_c" style="padding-bottom: 20rpx;">
							—— 省心app权益(正式会员) ——
						</view>
						<view class="d_f j_c_c" style="position: relative;">
						<image src="https://kshk.91bak.com/imagex/ljj/ljj.png" mode="widthFix" style="width: 660rpx;"></image>	
						<view class="d_f" style="position: absolute;left: 240rpx;top: 45rpx;font-size: 28rpx;font-weight: bold;">
							<view class="">
								省心APP购物金
							</view>
							<view class="">
								<image src="https://kshk.91bak.com/imagex/ljj/ck.png" mode="widthFix" style="width: 136rpx;margin-left: 100rpx;" @click="url"></image>	
							</view>
						</view>
						</view>
					
					<view class="d_f j_c_c" style="position: relative;margin-top: 24rpx;">
					<image src="https://kshk.91bak.com/imagex/ljj/app.png" mode="widthFix" style="width: 660rpx;"></image>	
					<view class="d_f" style="position: absolute;left: 240rpx;top: 45rpx;font-size: 28rpx;font-weight: bold;">
						<view class="">
							省心APP蜂王会员
						</view>
						<view class="">
							<image src="https://kshk.91bak.com/imagex/ljj/ck.png" mode="widthFix" style="width: 136rpx;margin-left: 70rpx;" @click="url"></image>	
						</view>
					</view>
					</view>
						<view class="d_f a_i_c j_c_c" style="padding-bottom: 20rpx;padding-top: 20rpx;">
							—— 立减金 ——
						</view>
					</view>
					<view class="d_f j_c_c "
						v-if="proType==1||proType==8||proType==9||proType==11||proType==15||proType==16"
						style="padding: 40rpx 0;">
						<view class="">
							——
						</view>
						<view class="card">
							立减金
						</view>

						<view class="">
							——
						</view>
					</view>
					<view class="">

						<view v-for="(item,index) in tldata" :key="index"
							:class="index==tldata.length-1?'boss1':'boss'">

							<view class="" v-if="item.status==0||item.status==7"
								style="padding-bottom: 10rpx;background-color: #FAFAFA;">

								<image src="https://web.78keji.cn/newimgaes/su.png" mode="widthFix"
									style="width: 100%;"></image>
								<view class="d_f" style="position: absolute;top: 0rpx;left: 30rpx;">
									<view class="d_f " style="color: #FFFFFF;font-weight: 800;">
										<view class="unit">
											￥
										</view>
										<view class="money">
											{{item.money}}
										</view>

									</view>
									<view class="" style="margin-left: 70rpx;margin-top: 30rpx;">
										<view class="" style="text-align: left;color: #232323;font-weight: bold;">
											通用立减金
										</view>
										<view class=""
											style="text-align: left;font-size: 16rpx;color: #0F0F0F;margin-top: 13rpx;">
											有效期{{item.starttime}}-{{item.endtime}}
										</view>
									</view>
									<view class="d_f j_c_c a_i_c" style="margin-left: 64rpx;">
										<image src="../../static/go.png" mode="widthFix" style="width: 136rpx;"
											v-if="item.status==0" @click="viplq(item)"></image>

										<image src="https://web.78keji.cn/newimgaes/timeno.png" mode="widthFix"
											style="width: 136rpx;" v-if="item.status==7"></image>

									</view>
								</view>
							</view>
							<view class=""
								v-if="item.status==2||item.status==1||item.status==3||item.status==4||item.status==5||item.status==6"
								style="padding-bottom: 10rpx;background-color: #FAFAFA;">
								<image src="https://web.78keji.cn/newimgaes/err.png" mode="widthFix"
									style="width: 660rpx;"></image>
								<view class="d_f" style="position: absolute;top: 0rpx;left: 30rpx;">
									<view class="d_f " style="color: #9A9A9A;font-weight: 800;">
										<view class="unit">
											￥
										</view>
										<view class="money">
											{{item.money}}
										</view>

									</view>
									<view class="" style="margin-left: 70rpx;margin-top: 30rpx;">
										<view class="" style="text-align: left;color: #9A9A9A;font-weight: bold;">
											通用立减金
										</view>
										<view class=""
											style="text-align: left;font-size: 16rpx;color: #9A9A9A;margin-top: 13rpx;">
											有效期{{item.starttime}}-{{item.endtime}}
										</view>
									</view>
									<view class="d_f j_c_c a_i_c" style="margin-left: 64rpx;">

										<view class="" style="color: #5EBB72;font-size: 24rpx;width: 136rpx"
											v-if="item.status==1">
											领取成功
										</view>
										<view class="" style="color: #5EBB72;font-size: 24rpx;width: 136rpx"
											v-if="item.status==3">
											发券成功
										</view>
										<view class="" style="color: #E8593F;font-size: 24rpx;width: 136rpx"
											v-if="item.status==2">
											发券失败
											<view class="cx" @click="viplq(item)">
												重领
											</view>
										</view>
										<view class="" style="color: #E8593F;font-size: 24rpx" v-if="item.status==5">
											领取失败
											<view class="cx" @click="viplq(item)">
												重领
											</view>
										</view>
										<view class=""
											style="color: #999999;font-size: 24rpx;text-align: center;width: 136rpx"
											v-if="item.status==4">
											已核销

										</view>
										<view class=""
											style="color: #999999;font-size: 24rpx;text-align: center;width: 136rpx"
											v-if="item.status==6">
											已到期/退款
										</view>


									</view>
								</view>
							</view>

						</view>
					</view>
				</view>
				<view class="" style="height: 266rpx;">

				</view>
				<view class="" v-if="proType==19||proType==21"
					style="height: 266rpx;color: #DB202D;font-size: 24rpx;width: 100%;text-align: center;position: fixed;bottom: 0;background-color: #FAFAFA;z-index: 9999;padding-top: 88rpx;">
					<text style="color:#3956DA" @click="jb=true">用户自助退订服务</text>
				</view>
			<!-- 	<view class="" v-if="proType==16||proType==17||proType==18"
					style="height: 266rpx;color: #DB202D;font-size: 24rpx;width: 100%;text-align: center;position: fixed;bottom: 0;background-color: #FAFAFA;z-index: 9999;padding-top: 88rpx;">
					<text style="color:#3956DA" >权益领取</text>
				</view> -->
				<view class="" v-if="proType==2"
					style="height: 266rpx;color: #DB202D;font-size: 24rpx;width: 100%;text-align: center;position: fixed;bottom: 0;background-color: #FAFAFA;z-index: 9999;padding-top: 88rpx;">
					*<text style="color: #333333;">购买成功开始，每5天生成1张立减金（6张/期）</text>
				</view>
				<view class="" v-if="proType==1"
					style="height: 266rpx;color: #DB202D;font-size: 24rpx;width: 100%;text-align: center;position: fixed;bottom: 0;background-color: #FAFAFA;z-index: 9999;padding-top: 88rpx;">
					*<text style="color: #333333;">购买成功开始，每5天生成1张立减金（6张/期）</text>
				</view>
				<view v-if="proType==3" class=""
					style="height: 266rpx;color: #DB202D;font-size: 24rpx;width: 100%;text-align: center;position: fixed;bottom: 0;background-color: #FAFAFA;z-index: 9999;padding: 88rpx 73rpx 0 73rpx;">
					*<text
						style="color: #333333;">订购即下发6张1元(共计6元)；第二个月可领1张2元及1张5元立减金(共计7元)；第三个月可领1张2元立减金。（每张立减金领取后有效期为7天）</text>
				</view>
				<view v-if="proType==4" class=""
					style="height: 266rpx;color: #DB202D;font-size: 24rpx;width: 100%;text-align: center;position: fixed;bottom: 0;background-color: #FAFAFA;z-index: 9999;padding: 88rpx 73rpx 0 73rpx;">
					*<text style="color: #333333;">购买成功开始，每5天生成1张立减金(6张/期)</text>
				</view>

			</view>
		</view>
		<view class="" v-else style="width: 100%;text-align: center;padding-top: 390rpx;">
			<image src="https://web.78keji.cn/newimgaes/nologin.png" mode="widthFix" style="width:243rpx;"></image>
			<view class="" style="color: #808080;font-size: 24rpx;margin-top: 20rpx;">
				请登录领取
			</view>
		</view>




	</view>
</template>

<script>
	import {
		sendSms,
		checkSms,
		ljjList,
		wxLogin,
		ljjLq,
		getProType,
		qyOther,
		qyOtherLq,
		getAliUseridHjk,
		tcl,
		keep,
		keepLq,
		getQList,
		lqvip,
		unBind
	} from '../../api/index.js'
	import md5 from '@/utils/md5.js'
	import moment from '../../utils/moment.js'
	export default {
		data() {
			return {
				show2:false,
				showsp: false,
				content: '',
				jb:false,
				show3:false,
				datavip: [

					{
						"title": "南瓜电影会员",
						"image": "http:\/\/oss.sx24h.cn\/uploads\/20230818\/063858d8b616e6cc313c515fec2a42f7.png",
						"id": 31,
						"image2": "http:\/\/oss.sx24h.cn\/uploads\/20230818\/808c2241fe9819b5684000389018ff55.png"
					},

					{
						"title": "优酷黄金会员",
						"image": "http:\/\/oss.sx24h.cn\/uploads\/20230818\/e94b78193704a7629c20dc14468bea08.png",
						"id": 1,
						"image2": "http:\/\/oss.sx24h.cn\/uploads\/20230916\/0ff67e4644379333a37619752ee3762c.png"
					},

					{
						"title": "搜狐黄金会员",
						"image": "http:\/\/oss.sx24h.cn\/uploads\/20230818\/6e6f95e4fae8699ae8ae7af2c4da6a4a.png",
						"id": 13,
						"image2": "http:\/\/oss.sx24h.cn\/uploads\/20230818\/f6aa5f215da8b9619310b85d04c3dcc8.png"
					}

				
				],
				codeshow: false,
				shcode: [],
				contents: '',
				content1: '是否解绑此产品？',
				border: true,
				showx: false,
				keeplistx: [],
				env: '0',
				listx: [

					{
						name: '工商银行微信立减金',
						id: '5817'
					},
					{
						name: '招商银行微信立减金',
						id: '5816'
					},
					{
						name: '农业银行微信立减金',
						id: '5813'
					},
					{
						name: '建设银行微信立减金',
						id: '5814'
					},
					{
						name: '中国银行微信立减金',
						id: '5815'
					},

				],
				// u-radio-group的v-model绑定的值如果设置为某个radio的name，就会被默认选中
				value: '',
				shows: false,
				list: [

				],
				current: 0,
				mobile: "",
				show: false,
				code: "",
				getCodeText: '获取验证码',
				getCodeBtnColor: "#ffffff",
				getCodeisWaiting: false,
				disabled: false,
				openid: "", //是否登录
				proType: '',
				xmlydata: [],
				tldata: [],
				ljjid: "", //立减金id
				idx: "", //省心会员券id
				quan_code: "",
				vip: "",
				qid: '',
				goodsId: "",
				checkx:true,
				imsp: "",
				accountType:'2',


			}
		},
		components: {

		},
		methods: {
			url(){
				window.location.href='https://a.app.qq.com/o/simple.jsp?pkgname=com.shengxinsx.app'
			},
			confirm() {
				// console.log('gid',this.qid)	
				console.log('goodsId', this.goodsId)
				lqvip({
					qid: this.qid,
					goodsId: this.goodsId,
					img: this.imsp
				}).then((res) => {
					uni.showToast({
						title:res.msg,
						icon: 'none',
						duration: 2000
					});
					this.getvip()

				})
			},
			confirm1() {
		
				unBind().then((res) => {
				
				
			this.show2=true
				})
			},
			
			getid(item) {
				console.log(item)
				if (item.status == 0) {
					this.showsp = true
					this.qid = item.id
				} else {
					uni.showToast({
						title: '已领取',
						icon: 'none',
						duration: 2000
					});
				}
			},
			getsp(itemx, items) {
				console.log(itemx)
				this.goodsId = itemx.id
				this.imsp = itemx.image
				this.contents = '是否领取' + itemx.title + '？'

			},
			keepllq(item) {
				uni.showLoading({
					title: '领取中'
				});
				keepLq({
					openid: this.openid,
					type: 3,
					id: item
				}).then((res) => {
					uni.showToast({
						title: '成功',
						icon: 'none',
						duration: 2000
					});
					this.getdata()
					uni.hideLoading()
				})
			},
			tcllq() {
				uni.showLoading({
					title: '领取中'
				});
				tcl({
					openid: this.openid,
					type: 3
				}).then((res) => {
					uni.showToast({
						title: '成功',
						icon: 'none',
						duration: 2000
					});
					this.getdata()
					uni.hideLoading()
				})
			},
			xiaowu() {
				window.location.href = 'http://tx-sh37.heyqiwu.cn/download/XiaowuStory.html'
			},
			copys() {
				uni.setClipboardData({
					data: this.quan_code,
					success: () => {
						uni.showToast({
							title: '复制成功',
							icon: 'none',
							duration: 2000
						});
						// this.codeshow=true
					}
				});
			},
			copy(item) {
				console.log(item.quan_code)
				uni.setClipboardData({
					data: item.quan_code,
					success: () => {
						uni.showToast({
							title: '复制成功',
							icon: 'none',
							duration: 2000
						});
						// this.codeshow=true
					}
				});
			},
			codelq(item) {
				console.log(item)
				qyOtherLq({
					openid: this.openid,
					type: 3,
					id: item.id
				}).then((res) => {
					uni.showLoading({
						title: res.msg,
						mask: true
					});
					this.codeshow = true
					this.quan_code = res.data.quan_code
					qyOther({
						openid: this.openid,
						type: 3,

					}).then((res) => {
						console.log(res)
						this.shcode = res.data
					})
				})
			},
			add(item) {
				this.shows = true
				this.ljjid = item
			},
			viplq(item) {
				this.content = this.mobile
				console.log(item)
				this.idx = item.id
				if (this.proType == 1) {
					this.showx = true
				}
				if (this.proType == 2 || this.proType == 15 || this.proType == 16) {
					if (item.env == 1) {
						this.showx = true
					} else {
						this.shows = true
						this.ljjid = item.id

					}

				} else if (this.proType == 3) {
					uni.showLoading({
						title: '领取中，请稍等',
						mask: true
					});
					ljjLq({
						openid: this.openid,
						type: 3,
						id: this.idx,
						account: uni.getStorageSync('openidHF'),
						accountType: 2,
						bankType: 1

					}).then((res) => {
						uni.showToast({
							title: res.msg,
							icon: "none"
						}); //弹出提示框
						this.getdata()
					})
				} else if (this.proType == 4) {
					console.log(item)
					if (item.env == 1) {
						this.showx = true
					} else if (item.env == 2) {
						ljjLq({
							openid: this.openid,
							type: 3,
							id: this.idx,
							account: uni.getStorageSync('openidHF'),
							accountType: 2,
							bankType: 1

						}).then((res) => {
							uni.showToast({
								title: res.msg,
								icon: "none"
							}); //弹出提示框
							this.getdata()
						})
					}
				} else if(this.proType == 20){
					this.show3=true
						this.idx = item.id
						this.ljjid = item.id
				}else {
					this.showx = true
				}

			},
			getvip() {
				getQList({
					status: 'all'
				}).then((res) => {
					this.vip = res.data[6].list
				

				})
			},
			//支付宝领取
			viplingqu() {
				uni.showLoading({
					title: '领取中，请稍等',
					mask: true
				});
				ljjLq({
					openid: this.openid,
					type: 3,
					id: this.idx,
					account: this.content,
					accountType: 1,
					bankType: 2

				}).then((res) => {
					uni.showToast({
						title: res.msg,
						icon: "none"
					}); //弹出提示框
					this.showx = false

this.show3=false

					this.getdata()
					if (this.env == 1) {
						let url = 'http://sign.syhy123.com/api/Clhk/extParam?url=' + encodeURIComponent(
							'alipayqr://platformapi/startapp?saId=88888888')
						window.location.href = url
					} else if (this.env == 2) {
						let url =
							'https://ulink.alipay.com/?scheme=alipays%3A%2F%2Fplatformapi%2Fstartapp%3FsaId%3D10000007%26clientVersion%3D3.7.0.0718%26qrcode%3D' +
							encodeURIComponent(encodeURIComponent(
								'https://render.alipay.com/p/s/i/?scheme=alipayqr://platformapi/startapp?saId=88888888'
							));
						window.location.href = url
					} else {
						let url = 'alipayqr://platformapi/startapp?saId=88888888'
						window.location.href = url
					}
				}).catch((err) => {
					console.log(err)
				})
			},
			lingqus() {
				if (this.value == '') {

					uni.showToast({
						title: '请先选择发放立减金银行',
						icon: "error"
					}); //弹出提示框
				} else {
					uni.showLoading({
						title: '领取中，请稍等',
						mask: true
					});
					
					ljjLq({
						openid: this.openid,
						type: 3,
						id: this.ljjid,
						account: uni.getStorageSync('openidHF'),
						accountType: this.accountType,
						bankType: this.value

					}).then((res) => {
						uni.showToast({
							title: res.msg,
							icon: "none"
						}); //弹出提示框
						this.shows = false
						this.show3=false
						this.getdata()
					})
				}

			},
			change(index) {
				window.scrollTo(0, 0)
				if (!uni.getStorageSync('openid')) {
					uni.showToast({
						title: '请先登录',
						icon: "none"
					}); //弹出提示框

				} else {
					this.current = index;
					this.getdata()
					if (uni.getStorageSync('token')) {
						this.getvip()
					}
				}

			},
			//推出登录
			loginout() {
				uni.removeStorageSync('openid');
				uni.removeStorageSync('mobile');

				this.openid = ''
				this.xmlydata = []
				this.tldata == []
				this.list = []
			},
			//获取验证码
			getCode() {
				sendSms({
					mobile: this.mobile,

				}).then((res) => {
					this.disabled = true
					this.getCodeText = "发送中..." //发送验证码
					this.getCodeisWaiting = true;
					setTimeout(() => {
						//this.$common.msg('验证码已发送')
						uni.showToast({
							title: '验证码已发送',
							icon: "none"
						}); //弹出提示框
						this.setTimer(); //调用定时器方法
					}, 1000)
				})
			},
			setTimer() {
				let holdTime = 60; //定义变量并赋值
				this.getCodeText = "重新获取(60)"
				//setInterval（）是一个实现定时调用的函数，可按照指定的周期（以毫秒计）来调用函数或计算表达式。
				//setInterval方法会不停地调用函数，直到 clearInterval被调用或窗口被关闭。
				this.Timer = setInterval(() => {
					if (holdTime <= 0) {
						this.disabled = false
						this.getCodeisWaiting = false;
						this.getCodeBtnColor = "#ffffff";
						this.getCodeText = "获取验证码"
						clearInterval(this.Timer); //清除该函数
						return; //返回前面
					}
					this.getCodeText = "重新获取(" + holdTime + ")"
					holdTime--;
				}, 1000)
			},
			getdatas() {

				console.log(this.current)
				ljjList({
					openid: this.openid,
					type: 3,
					proType: 2
				}).then((res) => {
					console.log(res)
					this.xmlydata = res.data


					for (var i in this.xmlydata) {
						if (this.xmlydata[i].status == 0) {
							if (Date.now() < this.xmlydata[i].starttime * 1000) {
								this.xmlydata[i].status = '7'
							}
						}

						this.xmlydata[i].starttime = moment(this.xmlydata[i].starttime * 1000).format(
							"YYYY-MM-DD")
						this.xmlydata[i].endtime = moment(this.xmlydata[i].endtime * 1000).format("YYYY-MM-DD")
					}

				})


				ljjList({
					openid: this.openid,
					type: 3,
					proType: 1
				}).then((res) => {
					console.log(res)
					this.tldata = res.data
					for (var i in this.tldata) {
						if (this.tldata[i].status == 0) {
							if (Date.now() < this.tldata[i].starttime * 1000) {
								this.tldata[i].status = '7'
							}
						}

						this.tldata[i].starttime = moment(this.tldata[i].starttime * 1000).format(
							"YYYY-MM-DD")
						this.tldata[i].endtime = moment(this.tldata[i].endtime * 1000).format("YYYY-MM-DD")
					}
				})


				ljjList({
					openid: this.openid,
					type: 3,
					proType: 3
				}).then((res) => {
					console.log(res)
					this.tldata = res.data
					for (var i in this.tldata) {
						if (this.tldata[i].status == 0) {
							if (Date.now() < this.tldata[i].starttime * 1000) {
								this.tldata[i].status = '7'
							}
						}

						this.tldata[i].starttime = moment(this.tldata[i].starttime * 1000).format(
							"YYYY-MM-DD")
						this.tldata[i].endtime = moment(this.tldata[i].endtime * 1000).format("YYYY-MM-DD")
					}
				})

			},
			//点击喜马拉雅获取数据
			getxmly() {
				ljjList({
					openid: this.openid,
					type: 3,
					proType: this.proType
				}).then((res) => {
					console.log(res)
					this.xmlydata = res.data


					for (var i in this.xmlydata) {
						if (this.xmlydata[i].status == 0) {
							if (Date.now() < this.xmlydata[i].starttime * 1000) {
								this.xmlydata[i].status = '7'
							}
						}

						this.xmlydata[i].starttime = moment(this.xmlydata[i].starttime * 1000).format(
							"YYYY-MM-DD")
						this.xmlydata[i].endtime = moment(this.xmlydata[i].endtime * 1000).format("YYYY-MM-DD")
					}

				})
			},
			//d点击非喜马拉雅数据
			gettldata() {
				ljjList({
					openid: this.openid,
					type: 3,
					proType: this.proType
				}).then((res) => {
					console.log(res)
					this.tldata = res.data

					for (var i in this.tldata) {
						if (this.tldata[i].status == 0) {
							if (Date.now() < this.tldata[i].starttime * 1000) {
								this.tldata[i].status = '7'
							}
						}

						this.tldata[i].starttime = moment(this.tldata[i].starttime * 1000).format(
							"YYYY-MM-DD")
						this.tldata[i].endtime = moment(this.tldata[i].endtime * 1000).format("YYYY-MM-DD")
					}
				})
			},
			getdata() {
				console.log(this.current)

				this.proType = this.list[this.current].proType
				console.log(this.proType)
				if(this.proType==2||this.proType==6||this.proType==16||this.proType==17||this.proType==18){
				
					// window.location.href='https://h5.zzqz2024.com/pages/lhhy/equity'
				}
				if (this.proType == '4' || this.proType == '1') {
					keep({
						openid: this.openid,
						type: 3,
						protype: -1
					}).then((res) => {
						console.log(res)
						this.keeplistx = res.data
						for (var i in this.keeplistx) {


							this.keeplistx[i].starttime = moment(this.keeplistx[i].starttime * 1000).format(
								"YYYY-MM-DD")
							this.keeplistx[i].endtime = moment(this.keeplistx[i].endtime * 1000).format(
								"YYYY-MM-DD")
						}
					})

				}
				this.gettldata()




			},
			// getUrlCode(name) {
			// 	return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) ||
			// 		[, ''
			// 		])[1]
			// 		.replace(/\+/g, '%20')) || null
			// },
			// checkWeChatCode() {
			// 	let code = this.getUrlCode('code')
			// 	if (code) {
			// 		wxLogin({
			// 			code: code,
			// 			type: 2,
			// 			proid: ''
			// 		}).then((res) => {
			// 			if (res.code == 1) {
			// 				console.log(res)
			// 				uni.setStorageSync('openidHF', res.data.openidH5)
			// 			} else {
			// 				// this.changes()
			// 			}
			// 		}).catch((err) => {
			// 			// this.changes()
			// 		})
			// 	} else {
			// 		this.changes()
			// 	}
			// },
			getdt() {
				ljjList({
					openid: this.openid,
					type: 3,
					proType: 3
				}).then((res) => {
					console.log(res)
					this.tldata = res.data
					for (var i in this.tldata) {
						if (this.tldata[i].status == 0) {
							if (Date.now() < this.tldata[i].starttime * 1000) {
								this.tldata[i].status = '7'
							}
						}

						this.tldata[i].starttime = moment(this.tldata[i].starttime * 1000).format(
							"YYYY-MM-DD")
						this.tldata[i].endtime = moment(this.tldata[i].endtime * 1000).format("YYYY-MM-DD")
					}
				})
			},
			changes() {
				let local = window.location.href;

				let url = 'https://h5.sx2b2c.com/wx_shouquan/#/?targetUrl=' + encodeURIComponent(
					window.location.href);
				console.log('gotoH5WxPlatformLoginUrl', url)

				window.location.href = url;
			},
			getUrlCode(name) {
				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) ||
					[, ''
					])[1]
					.replace(/\+/g, '%20')) || null
			},
			checkWeChatCode() {
				let code = this.getUrlCode('code')
				if (code) {
					getAliUseridHjk({
						code: code,
						type: 2
					}).then((res) => {
						if (res.code == 1) {
							console.log(res)

							uni.setStorageSync('openidHF', res.data.user_id)


						}
					})
				} else {
					this.changes()
				}
			},
			//点击登录
			login() {
				if (this.code == '') {
					uni.showToast({
						icon: 'none',
						title: '请输入验证码',
						duration: 2000
					});
				} else if (this.mobie == '') {
					uni.showToast({
						icon: 'none',
						title: '请输入手机号',
						duration: 2000
					});
				} else {
					checkSms({
						mobile: this.mobile,
						captcha: this.code,
						type: 3
					}).then((res) => {
						this.show = false
						uni.setStorageSync('openid', res.data.openid)
						uni.setStorageSync('mobile', res.data.mobile)
						uni.setStorageSync('token', res.data.token)
						this.mobile = uni.getStorageSync('mobile')
						this.openid = uni.getStorageSync('openid')
						this.token = uni.getStorageSync('token')
						this.getvip()
						qyOther({
							openid: this.openid,
							type: 3,

						}).then((res) => {
							console.log(res)
							this.shcode = res.data
						})
						getProType({
							openid: this.openid,
							type: 3
						}).then((res) => {

							for (var i in res.data) {

								res.data[i].name = res.data[i].proTypeName
								if (res.data[i].num != 0) {
									console.log(res.data[i])
									this.list.push(res.data[i])

								} else {

								}
							}

							this.getdata()


						})

					})
				}

			}
		},
		onLoad(option) {
			// unicomMiddle.tj({a:'123aaa',proCode: 'LH2513'}).then((res)=>{
			// 	console.log(res,'结果')
			// }).catch((err)=>{

			// })
			if(option.openidHF){
						uni.setStorageSync('openidHF',option.openidHF)
						this.accountType=3
						this.checkx=false
			}
			if (uni.getStorageSync('token')) {
				this.getvip()
			}


			let ua = window.navigator.userAgent.toLowerCase();
			//判断是不是微信
			if (ua.match(/MicroMessenger/i) == "micromessenger") {
				if (/Android/.test(navigator.userAgent)) {
					this.env = 1
				}
				if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
					this.env = 2
				}

				if (!uni.getStorageSync('openidHF')) {
					this.checkWeChatCode()
				}

			}
			//判断是不是支付宝
			else if (ua.match(/AlipayClient/i) == "alipayclient") {

			} else {

			}
			if (option.mobile) {
				this.mobile = option.mobile
				uni.setStorageSync('mobile', this.mobile)
				this.openid = md5.hex_md5(option.mobile + '456')
				uni.setStorageSync('openid', this.openid)
			}
			if (uni.getStorageSync('mobile')) {
				this.mobile = uni.getStorageSync('mobile')
				this.openid = md5.hex_md5(this.mobile + '456')
				uni.setStorageSync('openid', this.openid)
			}
			if (uni.getStorageSync('openid')) {
				console.log(11111)
				this.openid = uni.getStorageSync('openid')
				qyOther({
					openid: this.openid,
					type: 3,

				}).then((res) => {
					console.log(res)
					this.shcode = res.data
					getProType({
						openid: this.openid,
						type: 3
					}).then((res) => {

						for (var i in res.data) {

							res.data[i].name = res.data[i].proTypeName
							if (res.data[i].num != 0) {
								console.log(res.data[i])
								this.list.push(res.data[i])
								console.log(this.list, this.shcode)



							} else {

							}
						}
						if (this.shcode.length > 0) {
							this.list.push({
								name: "团油",
								num: 1,
								proType: 100,
								proTypeName: "团油"
							})
						}
						this.getdata()


					})
				})




			}


		},
		watch: {

		},
		computed: {

		}
	}
</script>

<style scoped lang='scss'>
	.cx {
		width: 136rpx;
		height: 50rpx;
		background: linear-gradient(90deg, #5B8CCF, #6570CB);
		border: 2px solid #FFFFFF;
		border-radius: 25rpx;
		line-height: 50rpx;
		color: #FFFFFF;
		margin-top: 15rpx;
	}

	.money {
		font-size: 90rpx;
		color: white;
	}

	.unit {
		margin-top: 50rpx;
		color: white;
		font-size: 40rpx;
	}

	.box {
		background-color: #FAFAFA;
		min-height: 100vh;
	}

	.title {

		font-size: 34rpx;

		font-weight: 400;
		color: #1A1A1A;
		margin-top: 50rpx;

	}

	.boss1 {
		background-color: white;
		width: 662rpx;
		border-radius: 12rpx;
		margin: 0 auto;

		text-align: center;
		position: relative;
	}

	.boss {
		background-color: white;
		width: 662rpx;

		margin: 0 auto;

		text-align: center;
		position: relative;


	}

	.card {
		padding: 0 20rpx;
	}
</style>